#!/bin/bash
ansible all -m shell -a 'yum -y remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux \
docker-engine-selinux docker-engine'
ansible all -m shell -a 'wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -P /etc/yum.repos.d/  && yum -y install docker-ce-18.06.3.ce-3.el7'
ansible all -m shell -a 'systemctl enable docker && systemctl start docker'
ansible all -m shell -a 'mkdir -p /data/docker'
ansible all -m shell -a ' \
cat >/etc/docker/daemon.json <<-EOF
{
 "registry-mirrors": ["https://wxezogdu.mirror.aliyuncs.com"],
  "insecure-registries": ["harbor.xhaihua.cn:81"],
  "exec-opts": ["native.cgroupdriver=systemd"],
  "graph": "/data/docker"
}
EOF
'
ansible all -m shell -a  'systemctl restart docker && systemctl status docker'
